package com.hoas.comparedb.entity;

import java.util.List;
import java.util.Objects;

public class Table {

    private String tableSchema;

    private String tableName;

    private String tableComment;

    private String characterSetName;

    private String tableCollation;

    private List<TableColumn> tableColumns;

    private List<TableIndex> tableIndexes;

    public Table(String tableSchema, String tableName) {
        this.tableSchema = tableSchema;
        this.tableName = tableName;
    }

    public Table() {
    }

    public String getTableSchema() {
        return tableSchema;
    }

    public void setTableSchema(String tableSchema) {
        this.tableSchema = tableSchema;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getTableComment() {
        return tableComment;
    }

    public void setTableComment(String tableComment) {
        this.tableComment = tableComment;
    }

    public String getCharacterSetName() {
        return characterSetName;
    }

    public void setCharacterSetName(String characterSetName) {
        this.characterSetName = characterSetName;
    }

    public String getTableCollation() {
        return tableCollation;
    }

    public void setTableCollation(String tableCollation) {
        this.tableCollation = tableCollation;
    }

    public List<TableColumn> getTableColumns() {
        return tableColumns;
    }

    public void setTableColumns(List<TableColumn> tableColumns) {
        this.tableColumns = tableColumns;
    }

    public List<TableIndex> getTableIndexes() {
        return tableIndexes;
    }

    public void setTableIndexes(List<TableIndex> tableIndexes) {
        this.tableIndexes = tableIndexes;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Table table = (Table) o;
        return Objects.equals(tableName, table.tableName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tableSchema, tableName);
    }

}
